package com.example.goodsmanagementcabinet.base;

import android.app.Application;
import android.os.Build;
import android.os.Handler;
import android.os.StrictMode;
import android.text.TextUtils;

import com.example.goodsmanagementcabinet.db.DatabaseManager;
import com.example.goodsmanagementcabinet.finger.FingerHandler;
import com.example.goodsmanagementcabinet.speaker.Speaker_;
import com.example.goodsmanagementcabinet.utils.CrashHandler;
import com.orhanobut.logger.Logger;

import org.androidannotations.annotations.EApplication;

@EApplication
public class GoodBoxManagerApp extends Application {
    Handler mhandler;

    @Override
    public void onCreate() {
        super.onCreate();
        mhandler = new Handler();
        FingerHandler.getInstance().open(this, mhandler);
        CrashHandler crashHandler = CrashHandler.getInstance();
        crashHandler.init(this);
        Speaker_.getInstance_(this).init();
        Logger.init(this.getClass().getSimpleName()).hideThreadInfo();//
        DatabaseManager.getInstance(this);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.setVmPolicy(builder.build());
        }
    }

}
